<div>
  <%= link_to being_edited_order_url(order),
        :id => "link_being_edited",
        :method => :put,
        :title => order.status.being_edited? ? "【#{order.being_edited_by_user.full_name}】最近编辑于#{time_ago_in_words order.updated_at, false}前" : "将该订单设置成编辑状态，这样其他同事就不会进来操作了哦",
        :class => "order_status  left #{order.status.being_edited? ? 'h' : '' }" do %>
        <%= image_tag 'orders/lock.png' if order.being_edited_by_other_user? %>编辑
  <% end %>
  <%= link_to "生效",
        effected_order_url(order),
        :id => "link_effected",
        :method => :put,
        :title => order.status.effected? ? "【#{order.effected_by_user.full_name}】于#{time_ago_in_words order.updated_at,false}前设置成生效" : "将该订单设置成生效状态，以便其他同事可以继续追单：）",
        :class => "order_status  #{order.status.effected? ? 'h' : '' }" %>
  <%= link_to "作废",
        blanked_out_order_url(order),      
        :method => :put,
        :title => order.status.blanked_out? ? "【#{order.blanked_out_by_user.full_name}】于#{time_ago_in_words order.updated_at,false}前作废该单" : "将该订单作废",
        :class => "order_status  #{order.status.blanked_out? ? 'h' : '' }" %>
      
  <%= link_to "归档",
        filed_order_url(order),       
        :method => :put,
        :title => order.status.filed? ? "【#{order.filed_by_user.full_name}】于#{time_ago_in_words order.updated_at,false}前将该单归档" : "该单已经结算，可以归档保存啦",
        :class => "order_status right #{order.status.filed? ? 'h' : '' }" %>
  <%= link_to '打印合同', sales_contract_order_url(@order), :target => :_blank, :class => 'printer', :title => '销售合同打印' %>        
</div>
<%if flash[:notice].present?%>
  <script>alert("<%=flash[:notice]%>");</script>
<%end%>